1. Field of the Invention
Apparatuses and methods consistent with the present invention relate to encoding and decoding of color image data, and more particularly, to encoding and decoding color image data having a YCbCr format into a smaller amount of data by searching for a correlation between chrominance components Cb and Cr of the color image data.
2. Description of the Related Art
FIG. 1 is a diagram illustrating data constituting video having an RGB format and video having an YCbCr format.
The RGB format represents color video, divides a chrominance component of the color video into red (R), green (G), and blue (B) chrominance components, and represents the R, G, and B chrominance components. Here, the R, G, and B chrominance components have the same amount of data. For example, when a macroblock has a size of 16×16, the R, G, and B chrominance components have sizes of 16×16. However, the human eye is more sensitive to luminance components representing brightness than chrominance components representing colors. Thus, a format in which color video is divided into luminance and chrominance components to be represented may be used to reduce an amount of data. The YCbCr format is such a format.
In the YCbCr format, a larger amount of data is allocated to luminance components than chrominance components. Referring to FIG. 1, when the RGB format video of the 16×16 macroblock is represented as the YCbCr format video in the 16×16 macroblock, the RGB format video is represented as a 16×16 luminance block and 8×8 chrominance blocks Cb and Cr. Here, values of a luminance component Y and chrominance components Cb and Cr are calculated through weighted combinations of R, G, and B values. For example, the values of the luminance component Y and the chrominance components Cb and Cr are calculated using equations such as Y=0.29900R+0.58700G+0.11400B, Cb=−0.16874R−0.33126G+0.50000B, and Cr=0.50000R−0.41869G−0.08131B. As described above, color motion picture data having an YCbCr format includes a luminance component and two chrominance components. When the color motion picture data is encoded, the luminance component and the two chrominance components are separately encoded. In other words, the luminance component and the two chrominance components are encoded regardless of correlation between the two chrominance components.
FIG. 2 is a diagram of structures of color video data in 4:4:4, 4:2:2, and 4:2:0 formats.
When a motion picture is encoded, a color format of the motion picture is represented by a rate of a luminance component and chrominance components of pixels of the motion picture in a horizontal pixel line. Hereinafter, the luminance component is denoted Y, and the chrominance components are denoted Cb and Cr. The luminance (brightness) of one pixel is represented with eight bits in the ITU-R Recommendation, and the chrominance (color) of a pixel is represented with two chrominance components Cb and Cr each having eight bits. A coordinate system for representing colors is called a color space. In the Motion Picture Experts Group (MPEG) standards, a color format of a motion picture is represented using three 8-bit pieces of information, i.e., a luminance component Y and chrominance components Cb and Cr.
When a color motion picture is represented using a luminance component Y and chrominance components Cb and Cr, several types of color formats can be represented according to the rate of the luminance component Y and the chrominance components Cb and Cr. In the case of different color formats, luminance components Y of the different color formats are the same, but chrominance components Cb and Cr of the different color formats vary. Referring to FIG. 2, video having a 4:2:2 format is obtained by ½ downsampling chrominance components of a video having a 4:4:4 format in a horizontal direction, and video having a 4:2:0 format is obtained by ½ downsampling chrominance components of the video having the 4:2:2 format in a vertical direction.
As described above, in a conventional codec (MPEG, H.26x, VC1), RGB color video is converted into YCbCr color video to separate a luminance component and chrominance components from the YCbCr color video so on separately encode the luminance component and the chrominance components. Here, color video may have several different formats, such as 4:4:4, 4:2:2, and 4:2:0 formats, etc. In general, the conventional codec (MPEG, H.26x, VC1) receives video data having the 4:2:0 format to encode a luminance component Y and chrominance components Cb and Cr. An example of video data having the 4:2:0 format will now be described.
In a general method of encoding a motion picture, a luminance component Y and chrominance components Cb and Cr are encoded so as not to have temporal and spatial redundancies. The spatial redundancy is removed through intra-prediction between a neighboring block and a current block, and the temporal redundancy is removed through inter-prediction between a previous picture and a current picture. Here, only a difference component between the neighboring block and the current block, and only a difference component between the previous picture and the current picture, are encoded through the intra-prediction, so on improve compression efficiency.
In other words, only predictions for removing the temporal and spatial redundancies of the luminance component Y and the chrominance components Cb and Cr are performed. Redundancy removal using a correlation between the luminance component Y and the chrominance components Cb and Cr is not performed. However, when compressing high quality video such an H.264 high profile, the amount of data of the luminance component Y and the chrominance components Cb and Cr increases. Thus, a method of efficiently compressing high quality video is required.